<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Journal
 *
 * @ORM\Table(name="journal")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\JournalRepository")
 */
class Journal
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="title", type="string", length=255, options={"comment":"刊名"})
     */
    private $title;

    /**
     * @var int
     *
     * @ORM\Column(name="uid", type="integer", options={"comment":"系统用户ID"})
     */
    private $uid;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="create_journal_time", type="date", options={"comment":"最新出刊时间"})
     */
    private $createJournalTime;

    /**
     * @var int
     *
     * @ORM\Column(name="is_deleted", type="smallint")
     */
    private $isDeleted;

    /**
     * @var string
     *
     * @ORM\Column(name="require_note", type="text", options={"comment":"投稿备注"})
     */
    private $requireNote;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="create_time", type="datetime", options={"comment":"创建信息时间"})
     */
    private $createTime;

    /**
     * @ORM\OneToMany(targetEntity="Contacts", mappedBy="journal")
     */
    private $contacts;


    /**
     * Get id
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set title
     *
     * @param string $title
     *
     * @return Journal
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set uid
     *
     * @param integer $uid
     *
     * @return Journal
     */
    public function setUid($uid)
    {
        $this->uid = $uid;

        return $this;
    }

    /**
     * Get uid
     *
     * @return int
     */
    public function getUid()
    {
        return $this->uid;
    }

    /**
     * Set createJournalTime
     *
     * @param \DateTime $createJournalTime
     *
     * @return Journal
     */
    public function setCreateJournalTime($createJournalTime)
    {
        $this->createJournalTime = $createJournalTime;

        return $this;
    }

    /**
     * Get createJournalTime
     *
     * @return \DateTime
     */
    public function getCreateJournalTime()
    {
        return $this->createJournalTime;
    }

    /**
     * Set isDeleted
     *
     * @param integer $isDeleted
     *
     * @return Journal
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

    /**
     * Get isDeleted
     *
     * @return int
     */
    public function getIsDeleted()
    {
        return $this->isDeleted;
    }

    /**
     * Set requireNote
     *
     * @param string $requireNote
     *
     * @return Journal
     */
    public function setRequireNote($requireNote)
    {
        $this->requireNote = $requireNote;

        return $this;
    }

    /**
     * Get requireNote
     *
     * @return string
     */
    public function getRequireNote()
    {
        return $this->requireNote;
    }

    /**
     * Set createTime
     *
     * @param \DateTime $createTime
     *
     * @return Journal
     */
    public function setCreateTime($createTime)
    {
        $this->createTime = $createTime;

        return $this;
    }

    /**
     * Get createTime
     *
     * @return \DateTime
     */
    public function getCreateTime()
    {
        return $this->createTime;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->contacts = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add contact
     *
     * @param \AppBundle\Entity\Contacts $contact
     *
     * @return Journal
     */
    public function addContact(\AppBundle\Entity\Contacts $contact)
    {
        $this->contacts[] = $contact;

        return $this;
    }

    /**
     * Remove contact
     *
     * @param \AppBundle\Entity\Contacts $contact
     */
    public function removeContact(\AppBundle\Entity\Contacts $contact)
    {
        $this->contacts->removeElement($contact);
    }

    /**
     * Get contacts
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getContacts()
    {
        return $this->contacts;
    }
}
